#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

long long CGD(long long n, long long m)
{
	long long ret = 0;
	while (n % m)
	{
		ret = n % m;
		n = m;
		m = ret;
	}
	return m;
}


int main()
{
	long long n = 0, m = 0,sum = 0;
	scanf("%lld %lld", &n, &m);
	long long num = CGD(n, m);
	sum = num + n * m/num;
	printf("%lld", sum);
	return 0;
}